using UnityEngine;

namespace BCW.Friends
{
	public class FriendsUICountFriendsLable : MonoBehaviour
	{
		private void OnEnable()
		{
			Refresh();
			FriendsController.OnUpdatePlayerDB += Refresh;
			FriendsController.OnIdsListsUpdated += Refresh;
		}

		private void OnDisable()
		{
			FriendsController.OnUpdatePlayerDB -= Refresh;
			FriendsController.OnIdsListsUpdated -= Refresh;
		}

		public void Refresh()
		{
			base.gameObject.GetComponent<UILabel>().text = FriendsController.instance.FriendsIds.Count + "/100";
		}
	}
}
